package com.qkl.xiatang.app.utils;

import com.qkl.xiatang.app.dto.log.JobLogTitleDTO;

import java.util.ArrayList;
import java.util.List;

public class JobLogUtils {

    /**
     * 销售日志
     */
    private static List<JobLogTitleDTO> SALE_JOB_LOG_TITLE = new ArrayList<>();

    /**
     * 库存日志
     */
    private static List<JobLogTitleDTO> STOCK_JOB_LOG_TITLE = new ArrayList<>();

    /**
     * 视频日志
     */
    private static List<JobLogTitleDTO> VIDEO_JOB_LOG_TITLE = new ArrayList<>();

    /**
     * 统计饲料、动保 喂料情况
     */
    private static List<JobLogTitleDTO> STAT_FEED_JOB_LOG_TITLE = new ArrayList<>();

    static {
        init();
    }

    private static void init(){
        JobLogTitleDTO titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("pondName");
        titleDTO.setName("塘号");
        SALE_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("saleDate");
        titleDTO.setName("销售日期");
        SALE_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("totalWeigh");
        titleDTO.setName("总量");
        SALE_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("price");
        titleDTO.setName("单价");
        SALE_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("totalPrice");
        titleDTO.setName("总价");
        SALE_JOB_LOG_TITLE.add(titleDTO);

        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("feedName");
        titleDTO.setName("饲料名称 ");
        STOCK_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("logDate");
        titleDTO.setName("日期 ");
        STOCK_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("qty");
        titleDTO.setName("重量/斤 ");
        STOCK_JOB_LOG_TITLE.add(titleDTO);
        titleDTO = new JobLogTitleDTO();
        titleDTO.setKey("stock");
        titleDTO.setName("库存/斤 ");
        STOCK_JOB_LOG_TITLE.add(titleDTO);


        addTitle(VIDEO_JOB_LOG_TITLE,"pondName","塘号");
        addTitle(VIDEO_JOB_LOG_TITLE,"taskDate","日期");
        addTitle(VIDEO_JOB_LOG_TITLE,"ownerUserName","拍摄者");
        addTitle(VIDEO_JOB_LOG_TITLE,"fileTime","拍摄时间");
        addTitle(VIDEO_JOB_LOG_TITLE,"uploadUserName","上传者");
        addTitle(VIDEO_JOB_LOG_TITLE,"createTime","上传时间");
        addTitle(VIDEO_JOB_LOG_TITLE,"memo","备注");

        addTitle(STAT_FEED_JOB_LOG_TITLE,"dateInfo","日期");
        addTitle(STAT_FEED_JOB_LOG_TITLE,"feedInfo","饲料");
        addTitle(STAT_FEED_JOB_LOG_TITLE,"zooInfo","动保");
    }

    public static List<JobLogTitleDTO> statFeedTitle(){
        List<JobLogTitleDTO> list = new ArrayList<>();
        list.addAll(STAT_FEED_JOB_LOG_TITLE);
        return list;
    }

    public static List<JobLogTitleDTO> saleLogTitle(){
        List<JobLogTitleDTO> list = new ArrayList<>();
        list.addAll(SALE_JOB_LOG_TITLE);
        return list;
    }

    public static List<JobLogTitleDTO> stockLogTitle(){
        List<JobLogTitleDTO> list = new ArrayList<>();
        list.addAll(STOCK_JOB_LOG_TITLE);
        return list;
    }

    private static void addTitle(List<JobLogTitleDTO> list,String key,String name){
        JobLogTitleDTO titleDTO = new JobLogTitleDTO();
        titleDTO.setKey(key);
        titleDTO.setName(name);
        list.add(titleDTO);
    }

}
